﻿package  {
	
	import flash.display.MovieClip;
	import flash.events.Event;
	
	public class char extends MovieClip {
		
		
		public function char() 
		{
			addEventListener(Event.ENTER_FRAME, update);
		}
		
		public function update(e:Event):void
		{
			var dx:Number = parent.mouseX - x;
    		var dy:Number = parent.mouseY - y;
    
  		    var calcRot:Number = Math.atan2(dy, dx);
    
  	   	    rotation = calcRot * 180 / Math.PI;
		}
		
		public function swing():void
		{
			m.play();
		}
		
		public function mthrow():void
		{
			a.play();
		}
	}
	
}
